package com.boot.security.model.po;

import com.baomidou.mybatisplus.annotation.TableName;
import com.boot.persistence.validate.group.InsertGroup;
import com.boot.persistence.validate.group.SelectGroup;
import com.boot.security.model.SystemModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.SuperBuilder;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * @author 霜寒 <1621856595@qq.com>
 * @description 用户
 * @date 2019/8/23 23:15
 **/
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@SuperBuilder
@NoArgsConstructor
@TableName("tb_user")
@ApiModel(value = "用户对象")
public class User extends SystemModel {

    @NotNull(groups = InsertGroup.class)
    @ApiModelProperty(value = "用户名", name = "username")
    private String username;

    @Null(groups = SelectGroup.class)
    @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
    @ApiModelProperty(value = "密码", name = "password")
    private String password;

    @ApiModelProperty(value = "性别", name = "gender", notes = "0,false:男 1,true:女")
    private Boolean gender;

    @ApiModelProperty(value = "昵称", name = "nickname")
    private String nickname;

    @ApiModelProperty(value = "联系电话", name = "phone")
    private String phone;

    @ApiModelProperty(value = "电子邮箱", name = "email")
    private String email;

    @ApiModelProperty(value = "头像", name = "avatar")
    private String avatar;

    @ApiModelProperty(value = "状态", name = "status", notes = "0:正常 1:禁用 2:已注销")
    private Integer status;

}